#include "logger.h"
#include "ui_logger.h"



Logger::Logger(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Logger)
{
    ui->setupUi(this);

    MsgCounter = 0;

    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(updateCaption()));
    timer->start(1000);


}

Logger::~Logger()
{
    delete ui;
}

void Logger::updateCaption()
{
    MsgCounter++;
    ui->textEdit->append(QString::number(MsgCounter));

}

void Logger::FromOmronWidget()
{
    int W10 = WhereFins->GetPLCMemW(10);
    MsgCounter++;
    ui->textEdit->append("FromOmronWidget "+QString::number(W10));

}

void Logger::SetWhereFins(Fins *addr)
{

    WhereFins = addr;
    qDebug()<<"logger: fins addr = "<<addr;
}

